package router

import (
	"github.com/gin-gonic/gin"
	"go-process/controller"
	"go-process/mylog"
)

func ApiRouter(r *gin.Engine) {
	userGroup := r.Group("/user")
	userGroup.Use(mylog.Logger())
	{
		userGroup.GET("/:id", controller.UserController{}.GetUserById)
		userGroup.POST("/", controller.UserController{}.CreateUser)
		userGroup.PUT("/", controller.UserController{}.UpdateUser)
		userGroup.DELETE("/:id", controller.UserController{}.DeleteUser)
		userGroup.POST("/page", controller.UserController{}.GetUserList)
		userGroup.POST("/upload", controller.UserController{}.FileUpload)
		userGroup.POST("/upload-multiple", controller.UserController{}.FileUploadMultiple)
		userGroup.GET("/download/:name", controller.UserController{}.FileDownload)
		userGroup.GET("/download-csv", controller.UserController{}.FileDownloadCSV)
	}
}
